<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 500px;
            height: 320px;
            display: flex;
            flex-direction: column;
            margin: 50px auto;
            border: 3px solid #333;
        }

        .box>ul {
            height: 60px;
            display: flex;
        }

        .box>ul>li {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 30px;
            color: #fff;
            background-color: skyblue;
            cursor: pointer;
        }

        .box>ul>li.active {
            background-color: orange;
        }

        .box>ol {
            flex: 1;
            position: relative;
        }

        .box>ol>li {
            width: 100%;
            height: 100%;
            background-color: purple;
            font-size: 50px;
            color: #fff;
            position: absolute;
            left: 0;
            top: 0;
            display: none;
        }

        .box>ol>li.active {
            display: block;
        }
    </style>
</head>

<body>

    <div class="box" id="box1">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ol>
    </div>

    <div class="box" id="box2">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ol>
    </div>

    <div class="box" id="box3">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ol>
    </div>


    <div class="box" id="box4">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ol>
    </div>

    <div class="box" id="box5">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>

        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>

        </ol>
    </div>
    <script src="./tabs.js"></script>
    <script>
        // 实例化5个对象  
        var obj1 = new Mytabs('#box1',{type:'mouseover'});
        obj1.init();
        var obj2 = new Mytabs('#box2',{type:'mouseover'});
        obj2.init();
        var obj3 = new Mytabs('#box3',{type:'mouseover'});
        obj3.init();
        var obj4 = new Mytabs('#box4',{type:'mouseover'});
        obj4.init();
        var obj5 = new Mytabs('#box5',{type:'mouseover'});
        obj5.init();

    </script>
</body>
</html>